﻿using System;
using System.Drawing;

namespace SimpleTerminal.TerminalControl
{
    public class TerminalColor
    {

        private static readonly TerminalColor[] Colors = new TerminalColor[8] {
                new TerminalColor(Color.FromArgb(255,0, 0, 0)),
                new TerminalColor(Color.FromArgb(255,187, 0, 0)),
                new TerminalColor(Color.FromArgb(255,0, 100, 0)),
                new TerminalColor(Color.FromArgb(255,200, 175, 0)),
                new TerminalColor(Color.FromArgb(255,30, 144, 245)),
                new TerminalColor(Color.FromArgb(255,187, 0, 187)),
                new TerminalColor(Color.FromArgb(255,0, 205, 205)),
                new TerminalColor(Color.FromArgb(255,235, 235, 235))
        };
        private static readonly TerminalColor[] LightColors = new TerminalColor[8] {
                 new TerminalColor(Color.FromArgb(255,85, 85, 85)),
                 new TerminalColor(Color.FromArgb(255,255, 85, 85)),
                 new TerminalColor(Color.FromArgb(255,85, 255, 85)),
                 new TerminalColor(Color.FromArgb(255,255, 245, 85)),
                 new TerminalColor(Color.FromArgb(255,80, 190, 255)),
                 new TerminalColor(Color.FromArgb(255,255, 85, 255)),
                 new TerminalColor(Color.FromArgb(255,85, 255, 255)),
                 new TerminalColor(Color.FromArgb(255,255, 255, 255))
        };

        public static TerminalColor GetColor(int type)
        {
            if (type > 7)
            {
                throw new Exception("颜色下标超出范围");
            }
            return Colors[type];
        }
        public static TerminalColor GetLighColor(int type)
        {
            if (type > 7)
            {
                throw new Exception("颜色下标超出范围");
            }
            return LightColors[type];
        }

        public TerminalColor(Color color)
        {
            this.color = color;
        }

        public Color color;


    }
}
